import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main.vue'
import home from '../views/home'
import user from '../views/user'
import mall from '../views/mall'
import pageOne from '../views/other/pageOne.vue'
import pageTwo from '../views/other/pageTwo.vue'
import Login from '../views/login/login.vue'




//创建路由组件
Vue.use(VueRouter)

const routes=[
  {
    //主路由
    path : '/',
    name : 'Main',  
    redirect:'/home',//重定向到home页面                     
    component: Main,
    //子路由
    children:[
      // {
      //   path:'/home',
      //   name:'home',
      //   component:home
      // }, 
      // {
      //   path:'/mall',
      //   name:'mall',
      //   component:mall
      // },
      // {
      //   path:'/user',
      //   name:'user',
      //   component:user
      // },
      // {
      //   path:'/page1',
      //   name:'Page1',
      //   component:pageOne
      // },
      // {
      //   path:'/page2',
      //   name:'Page2',
      //   component:pageTwo
      // }
  ]
  },
  {
    path : '/login',
    name : 'login',
    component:Login
  },
]

export default new VueRouter({
    mode: 'history',
    routes
})